/* 错题集打开弹框 */
$('.fail-test-box .l-box .text').click(function (event) {
  event.stopPropagation();
  $('.dialog-mask').addClass('active');
  $('.dialog-box').addClass('active');
});

/* 错题集上下滑动 */ 
var swipersff = new Swiper('.sw-select', {
  direction: 'vertical',
  autoHeight: true,
  slidesPerView: 3,
  centeredSlides: true,
  observer: true,
  observeParents: true,
  observeSlideChildren: true,
});

/* 错题集上下滑动 */
var swiperDay = new Swiper('.day-select', {
  direction: 'vertical',
  autoHeight: true,
  slidesPerView: 3,
  centeredSlides: true,
  observer: true,
  observeParents: true,
  observeSlideChildren: true,
});

$('.sw-select .swiper-wrapper>div').click(function (event) {
  event.stopPropagation();
  swipersff.slideTo($(this).index(), 500, false);
});

$('.day-select .swiper-wrapper>div').click(function (event) {
  event.stopPropagation();
  swiperDay.slideTo($(this).index(), 500, false);
});

//取消按钮
$('#js-dialog-select-box .c-btn').click(function (event) {
  event.stopPropagation();
  $('.dialog-mask').removeClass('active');
  $('.dialog-box').removeClass('active');
});

//确定按钮
$('#js-dialog-select-box .e-btn').click(function (event) {
  event.stopPropagation();
  var $name = $('.sw-select').find('.swiper-slide.swiper-slide-active').html(),
    $day = $('.day-select').find('.swiper-slide.swiper-slide-active').html();

  $('.fail-test-box .l-box .text').html($name+'-'+$day);
  $('.dialog-mask').removeClass('active');
  $('.dialog-box').removeClass('active');
})